// Copyright 2019 The rhyme_lph Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// h [author] rhyme_lph
// J [email]  rhymelph@gmail.com
// v [github] https://github.com/rhymelph

import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/l10n.dart';
import 'package:finance_app/src/entities/employee_contact_entity.dart';
import 'package:flutter/material.dart';

class SelectLeaveTypeProvider extends BaseProvider {
  @override
  Future get dataFuture => null;

  void onSelect(EmployeeContactEmployeeLeaves e) {
    if (e.amount == 0) {
      showToast(S.current.please_select_other_leave);
      return;
    }
    obtainContext?.call((context) {
      Navigator.of(context).pop(e);
    });
  }
}
